Skip to content

fix(vscode): create settings.json on fresh profiles - #4

Merged
xscriptor merged 1 commit into
mainfrom
fix/vscode-missing-settings
Oct 25, 2026
Merged

xscriptor merged 1 commit into
mainfrom
fix/vscode-missing-settings

Conversation

@xscriptor

Copy link
Copy Markdown
Member

Root cause

The VS Code target only processed a variant when ~/.config/Code*/User/settings.json already existed. On a fresh profile with no saved settings, apply() silently skipped both Code and Code - Insiders, so VS Code stayed unthemed. This is not niri-specific: the niri shell does call theme-sync at startup and on palette changes; Hyprland only worked because its profile already had that file.

Fix

  • Treat a variant as installed when its User/ directory, extension directory or code/code-insiders binary exists.
  • Create User/settings.json if missing and write the normal theme block into it.
  • Log the creation ([created]) so the engine output is clear.
  • Add a temp-home check to scripts/check.sh that asserts the missing file is created with the managed block.
  • README/CHANGELOG updated.

Validation

  • python3 -m compileall -q themesync, bash -n scripts/check.sh, scripts/check.sh (155 palettes, vscode mapping, vscode create: OK).
  • Live test on this machine: the target created ~/.config/Code - Insiders/User/settings.json and applied the bright live tint; VS Code updated live (screenshot verified). The previously installed engine also processes the target now that the file exists.
  • No niri-specific patch or fork is needed.

@xscriptor
xscriptor merged commit 45f8343 into main Oct 25, 2026
2 checks passed
@xscriptor
xscriptor deleted the fix/vscode-missing-settings branch October 25, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant